﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace JzSport.Api.Params
{
    public class CreateActivityParams : IActionParams
    {
        public string Title { get; set; }
        public string CategoryCode { get; set; }
        public string Address { get; set; }
        public string City { get; set; }
        public double Longitude { get; set; }
        public double Latitude { get; set; }
        public DateTime BeginTime { get; set; }
        public DateTime EndTime { get; set; }
        public int MaxPersonCount { get; set; }
        public decimal CostPrePerson { get; set; }
        public string Descritpion { get; set; }
        /// <summary>
        /// imageid,imageid,imageid
        /// </summary>
        public string Images { get; set; }
        /// <summary>
        /// id1,id2,id3
        /// </summary>
        public string InviteFriends { get; set; }

        public void ParseQueryString(HttpRequest request)
        {
        }

        public void ParseForm(HttpRequest request)
        {
            this.Title = request.Form["op:title"];
            this.CategoryCode = request.Form["op:categorycode"];
            this.Address = request.Form["op:address"];
            this.City = request.Form["op:city"];
            this.Longitude = Convert.ToDouble(request.Form["op:longitude"]);
            this.Latitude = Convert.ToDouble(request.Form["op:latitude"]);
            this.BeginTime = Convert.ToDateTime(request.Form["op:begintime"]);
            this.EndTime = Convert.ToDateTime(request.Form["op:endtime"]);
            this.MaxPersonCount = Convert.ToInt32(request.Form["op:maxpersoncount"]);
            this.CostPrePerson = Convert.ToDecimal(request.Form["op:costpreperson"]);
            this.Descritpion = request.Form["op:descritpion"];
            this.Images = request.Form["op:images"];
            this.InviteFriends = request.Form["op:invitefriends"];

            this.CategoryCode = request.Form["op:categorycode"];
        }
    }
}
